package com.woniuxy.cloud.batteryassembly.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniuxy.cloud.batteryassembly.model.BatteryType;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author gaorui
 * @since 2022-02-09
 */
public interface BatteryTypeMapper extends BaseMapper<BatteryType> {

    @Select("    SELECT DISTINCT t1.* FROM `battery_type` t1  JOIN  battery t2 ON t1.battery_type_id=t2.battery_type_id\n" +
            "    WHERE  t2.battery_status=0 and t2.battery_del=0 and t2.location_id=#{locationId}")
    List<BatteryType> listBatteryTypeByLocationId(Integer locationId);

}
